<?php get_header(); ?>

	<div id="container">
		<div id="content" class="hfeed">

<?php the_post(); ?>

			<div id="nav-above" class="navigation">
				<div class="nav-previous"><?php previous_post_link('&laquo; %link') ?></div>
				<div class="nav-next"><?php next_post_link('%link &raquo;') ?></div>
			</div>

			<div id="post-<?php the_ID(); ?>" class="<?php sandbox_post_class(); ?>">
				<div class="entry-meta">
					<?php
					$current_user_id = get_the_author_ID( );
					echo get_avatar( $current_user_id, get_the_author_email( ), 96 );
					?>
					<ul>
						<li class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO'); ?>"><?php unset($previousday); printf(__('%1$s &#8211; %2$s', 'sandbox'), the_date('', '', '', false), get_the_time()) ?></abbr></li>
						<li class="entry-category"><?php printf(__('Posted in %s', 'sandbox'), get_the_category_list(', ')) ?></li>
						<?php the_tags(__('<li class="entry-tags">Tagged ', 'sandbox'), ", ", "</li>\n") ?>
<?php edit_post_link(__('Edit', 'sandbox'), "\t\t\t\t\t<li class='entry-editlink'>", "</li>"); ?>
					</ul>
				</div>
				<div class="entry-content">
					<h2 class="entry-title"><?php the_title() ?></h2>
<?php the_content('<span class="more-link">'.__('Read More &raquo;', 'sandbox').'</span>'); ?>

<?php link_pages('<div class="page-link">'.__('Pages: ', 'sandbox'), '</div>', 'number'); ?>
<?php
$this_post = $post;
$category = get_the_category(); $category = $category[0]; $category = $category->cat_ID;
$posts = get_posts('numberposts=6&offset=0&orderby=post_date&order=DESC&category='.$category);
$count = 0;
foreach ( $posts as $post ) {
	if ( $post->ID == $this_post->ID || $count == 5) {
	unset($posts[$count]);
	}else{
	$count ++;
	}
}
?>
<?php if ( $posts ) : ?>
<div class="entrytitle">
<p>See also:</p>
<ul>
<?php foreach ( $posts as $post ) : ?>
<li><a rel="nofollow" href="<?php the_permalink() ?>" title="<?php echo trim(str_replace("\n"," ",preg_replace('#<[^>]*?>#si','',get_the_excerpt()))) ?>"><?php if ( get_the_title() ){ the_title(); }else{ echo "Untitled"; } ?></a> (<?php the_time('F jS, Y') ?>)</li>
<?php endforeach // $posts as $post ?>
</ul>
	</div>
<?php endif // $posts ?>
				</div>
			</div>

			<div id="nav-below" class="navigation">
				<div class="nav-previous"><?php previous_post_link('&laquo; %link') ?></div>
				<div class="nav-next"><?php next_post_link('%link &raquo;') ?></div>
			</div>

<?php if ( comments_open() ) comments_template(); ?>

		</div>
	</div>

<?php get_sidebar(); ?>
<?php get_footer(); ?>
